<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>The small3d library: Developing a game in parallel with small3d</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo_s.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">The small3d library
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">Developing a game in parallel with small3d </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>These are the steps to add an existing small3d-based project to the small3d directory and link it with the small3d library project/solution, so that it can be debugged and modified in parallel with small3d.</p>
<ul>
<li>Build small3d but then delete the build folder. This will prepare all small3d dependencies (in the deps folder).</li>
<li>Copy the folder of the project to be added to the small3d root folder</li>
<li>Add the project folder name to the subdirs statement in small3d/CMakeLists.txt</li>
<li>Remove everything from CMakeLists.txt at the root of the added project, only leaving these lines: <pre class="fragment">  project(projectname)
  file(COPY "resources" DESTINATION "${PROJECT_BINARY_DIR}/bin")
  subdirs(src)
</pre></li>
<li>In the added project subfolder, edit src/CMakeLists.txt and replace reference variables to the small3d library like ${SMALL3D_LIBRARY} by the simple string "small3d" (without quotes).</li>
<li><p class="startli">Go to the root of the small3d project and execute: </p><pre class="fragment">  mkdir build
  cd build
</pre><p class="startli">and then the cmake configuration and build commands, e.g.: </p><pre class="fragment">  cmake .. -G"Visual Studio 17 2022"
  cmake --build . --config Debug
</pre></li>
<li>Everything is now ready. If using Visual Studio you can find the solution in the build folder. The binaries for the small3d unit tests and the added project will be in the usual location, build/bin.</li>
<li>If using Visual Studio, you might need to open the properties of the added project, and set Configuration Properties &gt; Debugging &gt; Working Directory to the small3d/build/bin directory, because cmake may have added the project folder name before the /bin part, possibly causing the subproject executable to not be able to find required files like shaders and models. Also don't forget to set the added project as the startup project if you would like to run and debug it.</li>
<li>Make sure that the resources folder contains the correct files for the project you would like to run, the added one or the small3d unit tests. If resources between the two have the same names they may have overwritten each other or they may cause other problems, depending on the project added. </li>
</ul>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
</small></address>
</body>
</html>
